package com.wenjie.original.entity.vo.Order;

import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.RelationOneToOne;
import com.wenjie.original.entity.Order;
import com.wenjie.original.entity.Sku;
import com.wenjie.original.entity.User;
import com.wenjie.original.entity.common.vo.IResVo;
import com.wenjie.original.entity.common.vo.ISelVo;
import com.wenjie.original.entity.vo.OrderBox.OrderBoxVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

public class OrderVo {

    @Data
    public static class SelVo extends Order implements ISelVo<Order> {

        @ApiModelProperty("当前页")
        private Integer pn = 1;

        @ApiModelProperty("页数")
        private Integer ps = 10;
    }

    @Data
    public static class ResVo extends Order implements IResVo<Order> {

        @RelationOneToOne(selfField = "skuId", targetField = "skuId")
        private Sku skuInfo;

        @RelationOneToOne(selfField = "userId", targetField = "userId")
        private User userInfo;

        @RelationOneToMany(selfField = "orderId", targetField = "orderId", targetTable = "order_box")
        private List<OrderBoxVo.ResVo> orderBoxs;


    }


    @Data
    public static class ResAddSku extends Order implements IResVo<Order> {
        @RelationOneToOne(selfField = "skuId", targetField = "skuId")
        private Sku skuInfo;

    }


}

